/*	=======================================================================	*/
/// <remarks>
/// Version:
///		- number:	0.0.5
///		- build:	20040517
///		- status:	dev/test/live
/// </remarks>
/*	=======================================================================	*/
/// <remarks>
/// Global Variables
/// </remarks>
	/*	==================================
		functions to handle pop-up windows
		==================================	*/
	var x_pop = new ClassX_Popup(x_debug);
/*	=======================================================================	*/
/// <remarks>
/// Class: ClassX_Popup
/// The ClassX_Popup object class has the following purpose/function:
///	- 
/// </remarks>
/*	-----------------------------------------------------------------------	*/
/// <summary>
/// The ClassX_Popup object class is constructed as follows:
///		var thisobj = new ClassX_Popup(dbg);
/// - where:
///		- dbg:	debugging switch
/// </summary>
function ClassX_Popup(dbg) {
	/*	-------------------------------------------	*/
	/// <remarks>Properties: Public</remarks>
	/*	-------------------------------------------	*/
	this.popwin;
	/*	-------------------------------------------	*/
	/// <remarks>Properties: Private</remarks>
	/*	-------------------------------------------	*/
	var _self = this;	// self allows for a method/property to be called internally
	var _debug = (dbg)? dbg : false;
	var _name = "xPop";
	/*	-------------------------------------------	*/
	/// <remarks>Region: Accessor methods</remarks>
	/*	-------------------------------------------	*/
	this.GetName = function() { return(_name); }
	/*	-------------------------------------------	*/
	/// <remarks>Region: Public methods</remarks>
	/*	-------------------------------------------	*/
	this.Demo = _Demo;
	this.Download = _Download;
	this.External = _External;
	this.PopUp = _PopUp;
	this.Help = _Help;
	this.Output = _Output;
	this.Umlungu = _Umlungu;
	this.Template = _Template;
	/// <summary>Method:_Template</summary>
	function _Demo(ul) { _pop(ul,true,false,500,700); }
	/// <summary>Method:_Template</summary>
	function _Download(ul) { _pop(ul,false); }
	/// <summary>Method:_Template</summary>
	function _External(ul) { _name = "xPopE"; _pop(ul,false); }
	/// <summary>Method:_Template</summary>
	function _PopUp(ul) { _pop(ul,true,true); }
	/// <summary>Method:_Template</summary>
	function _Help(ul) { _pop(ul,true,true,363,350); }
	/// <summary>Method:_Template</summary>
	function _Output(dv) {
		re = /siteid=\w*/gi;
		var ul = document.location.href.replace(re, "siteid=" + dv);
		var mn = (dv=="print" || dv=="download");
		_pop(ul,true,true,660,550,mn);
	}
	/// <summary>Method:_Template</summary>
	function _Umlungu(ul, pm) {
		ul = ul + "&" + eval(pm);
		_pop(ul,true,false,395,296);
	}
	/// <summary>Method:_Template</summary>
	function _Template(thisvar) {
		_Debug("_Template:", "thisvar", thisvar);
	}
	
	/*	-------------------------------------------	*/
	/// <remarks>Region: Private methods</remarks>
	/*	-------------------------------------------	*/
	/// <summary>Method:_pop</summary>
	function _pop(url, set, scr, wid, hgt, mnu) {
		var setting = "";
		if (set) {
			var mn = (mnu)? "yes" : "no";
			var sc = (scr)? "yes" : "no";
			var wd = (wid)? wid : "463";
			var ht = (hgt)? hgt : "400";
			setting = "toolbar=no,location=no,status=no,menubar="+mn+",scrollbars="+sc+",width="+wd+",height="+ht+",noresize";
		}
		this.popwin = window.open(url,_name, setting);
		try { this.popwin.focus(); }
		catch (e) { this.popwin.focus(); }
	}
	/// <summary>Method:_RaiseError</summary>
	function _RaiseError(thiserr) {
		_Debug("RaiseError:", "thiserr", thiserr);
		throw (thiserr);
	}
	/// <summary>Method:_Debug - write debugging message. First param is the method label, followed by name, value pairs</summary>
	function _Debug(arg) {
		if (_debug) {
			s = "<!-- ClassX_Popup::"
			s = s.concat(arguments[0], ":");
			var argn = arguments.length;
			for(var i=1; i<argn; i=i+2)
				s = s.concat(arguments[i], ":", arguments[i+1], " ");
			alert(s.concat("-->\n"));
		}
	}
	
}





